#ifndef SERVER_LEVEL_H
#define SERVER_LEVEL_H 1

#include <cstdio>
#include <string>

#include "zlib.h"

class Level
{
	public:
		Level();
		Level(short w, short h, short d);
		~Level();
		void blank(short w, short h, short d);
		int load(const char* name);
		void save(const char* name);
		int dump(char* array);
		int operator()(short x, short y, short z, char type);
		char operator()(short x, short y, short z);
		short WIDTH();
		short HEIGHT();
		short DEPTH();
	
	private:
		char* data;
		short w,h,d;
};

enum {
	BLOCK_AIR,
	BLOCK_STONE,
	BLOCK_GRASS,
	BLOCK_DIRT,
	BLOCK_COBBLESTONE,
	BLOCK_WOOD,
	BLOCK_SAPLING,
	BLOCK_ADMINIUM,
	BLOCK_WATER,
	BLOCK_STILL_WATER,
	BLOCK_LAVA,
	BLOCK_STILL_LAVA,
	BLOCK_SAND,
	BLOCK_GRAVEL,
	BLOCK_GOLD_ORE,
	BLOCK_IRON_ORE,
	BLOCK_COAL_ORE,
	BLOCK_LOG,
	BLOCK_LEAVES,
	BLOCK_SPONGE,
	BLOCK_GLASS,
	BLOCK_RED,
	BLOCK_ORANGE,
	BLOCK_YELLOW,
	BLOCK_LIME,
	BLOCK_GREEN,
	BLOCK_TEAL,
	BLOCK_LIGHT_BLUE,
	BLOCK_BLUE,
	BLOCK_PURPLE_BLUE,
	BLOCK_PURPLE, 
	BLOCK_VIOLET,
	BLOCK_PINK,
	BLOCK_LIGHT_PINK,
	BLOCK_BLACK,
	BLOCK_GREY,
	BLOCK_WHITE,
	BLOCK_FLOWER,
	BLOCK_ROSE,
	BLOCK_RED_SHROOM,
	BLOCK_BROWN_SHROOM,
	BLOCK_GOLD,
	BLOCK_IRON,
	BLOCK_DOUBLE,
	BLOCK_HALF,
	BLOCK_BRICK,
	BLOCK_TNT,
	BLOCK_BOOKSHELF,
	BLOCK_MOSSY,
	BLOCK_OBSIDIAN,
	BLOCK_TORCH,
	BLOCK_FIRE,
	BLOCK_WATER_SOURCE
};

#endif
